package com.jiannan.order.controller;

import com.jiannan.order.service.OrderService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
@AllArgsConstructor
public class OrderController {

    private final OrderService orderService;


    @GetMapping("/getStockByProductId")
    public Integer getStockByProductId(Integer product) {
        return orderService.getProductStock(product);
    }

}
